package com.ethink.order.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.order.api.info.TocSaleImportLogDetailInfo;
import com.ethink.order.common.entity.TocSaleImportLogDetail;

/**
 * TOC销售单导入日志明细 Converter转换器
 *
 * @author default
 * @date 2022-11-22
 */
@Component
public class TocSaleImportLogDetailConverter implements Converter<TocSaleImportLogDetailInfo, TocSaleImportLogDetail> {

    @Override
    public TocSaleImportLogDetail convertTo(TocSaleImportLogDetailInfo info) {
        if(info == null) {
            return null;
        }
        TocSaleImportLogDetail entity = new TocSaleImportLogDetail ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public TocSaleImportLogDetailInfo convertFrom(TocSaleImportLogDetail entity) {
        if(entity == null) {
            return null;
        }
        TocSaleImportLogDetailInfo info = new TocSaleImportLogDetailInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
